package com.loveprogrammer.lowercode.dna.service;

import com.loveprogrammer.lowercode.dna.def.Dna;
import com.loveprogrammer.lowercode.dna.def.DnaTool;
import com.loveprogrammer.lowercode.dna.instance.bo.Inst;
import com.loveprogrammer.lowercode.dna.common.CodeDefConst;
import com.loveprogrammer.lowercode.dna.instance.bo.Cell;
import com.loveprogrammer.lowercode.dna.party.dna.PartyDnaTool;

public class InstServiceTemp {
    public Inst init(String type, String businessType, String dnaCodeParty) {
        Dna dna = null;

        switch (dnaCodeParty) {
            case CodeDefConst.DNA_CODE_PARTY:
                dna = PartyDnaTool.getPartyDna();
                break;
            case CodeDefConst.DNA_CODE_PARTY_ACCOUNT:
                dna = PartyDnaTool.getPartyAccountDna();
                break;
            case CodeDefConst.DNA_CODE_ACCOUNT_USAGE:
                dna = PartyDnaTool.getAccounUsageDna();
                break;
            default:
                break;
        }

        Cell cell = DnaTool.dna2Cell(type, dna);
        Inst inst = new Inst(type,dna,cell);
        inst.setBusinessType(businessType);
        inst.setDnaName(dna.getDnaName());
        inst.setDnaCode(dna.getDnaCode());
        return inst;
    }
}
